package edu.bw.service.Impl;

import edu.bw.service.UserService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//<bean id="userServiceImpl" class="edu.bw.service.ImplServiceImpl"> 相当于下面的注解
//@Component("userService")   //括号中的内容就是bean的id
//@Component
@Service
@Data
public class UserServiceImpl implements UserService {

    @Value("12")  //直接将12注给num
    private int num;

    @Value("abc")  //将abc注入给str
    private String str;

}
